package DesignPattern.PublishAndSubscribe;

import java.util.ArrayList;
import java.util.List;

public interface Observer {
    /**
     * @Description: 通知，获取关注的公众号发布的消息
     * @Data:[]
     */
    void inform(String msg);
}

class XiaoWang implements Observer {
    public String name ;

    public XiaoWang(String name) {
        this.name = name;
    }

    @Override
    public void inform(String msg) {
        System.out.println(this.name + "收到消息：" + msg);
    }


    public static void main(String[] args) {
//        Integer a = new Integer(null);
//        System.out.println(a);
//
//        //订阅者
//        Observer xiaoWangObserver = new XiaoWang("小王");
//        //天气公众号
//        WeatherTencent weatherTencent = new WeatherTencent("天气公众号","今天天气很好");
//        weatherTencent.addToQueue(xiaoWangObserver);
//
//        weatherTencent.notifyObserver();


        List<String> rule = new ArrayList<>();
        String[] strings = rule.toArray(new String[rule.size()]);
        for (String string : strings) {
            System.out.println(string);
        }
    }
}

 class Heart {

}
